2021-05-29 LGTMoonの画像が帰ってこない
問題が2つある
S3にアップロードする時にエラーが出ている
エラーで失敗しているにも関わらず、DBには成功として書き込んでしまっている
code:sh
[[31merror0m - storage.ImageWasabiS3 - LGTM画像を Wasabi S3 にアップロードしようとしてエラー at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1207)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1153)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:802)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:770)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:744)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:704)
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:686)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:550)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:530)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5247)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5194)
at com.amazonaws.services.s3.AmazonS3Client.access$300(AmazonS3Client.java:415)
at com.amazonaws.services.s3.AmazonS3Client$PutObjectStrategy.invokeServiceCall(AmazonS3Client.java:6308)
at com.amazonaws.services.s3.AmazonS3Client.uploadObject(AmazonS3Client.java:1840)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1800)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1732)
at storage.ImageWasabiS3.putObject(ImageWasabiS3.scala:104)
at storage.ImageWasabiS3.save(ImageWasabiS3.scala:130)
at actor.ImageActor$$anonfun$receive$1.applyOrElse(ImageActor.scala:33)
at akka.actor.Actor.aroundReceive(Actor.scala:534)
at akka.actor.Actor.aroundReceive$(Actor.scala:532)
at actor.ImageActor.aroundReceive(ImageActor.scala:18)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:573)
at akka.actor.ActorCell.invoke(ActorCell.scala:543)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:269)
at akka.dispatch.Mailbox.run(Mailbox.scala:230)
at akka.dispatch.Mailbox.exec(Mailbox.scala:242)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:507)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.connectSocket(SdkTLSSocketFactory.java:142)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect2)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.amazonaws.http.conn.ClientConnectionManagerFactory$Handler.invoke(ClientConnectionManagerFactory.
at com.amazonaws.http.conn.$Proxy24.connect(Unknown Source)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at com.amazonaws.http.apache.client.impl.SdkHttpClient.execute(SdkHttpClient.java:72)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1331)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1145)
... 29 common frames omitted
原因
証明書は設定されているようだが、間違って設定されてしまっている
*.ap-northeast-1-ntt.wasabisys.com の証明書が設定されている
* の部分にドット . を含むことはできないので、この証明書は間違っている。
以下のような証明書なら OK
image.lgtmoon.dev.s3.ap-northeast-1-ntt.wasabisys.com
*.lgtmoon.dev.s3.ap-northeast-1-ntt.wasabisys.com
コード修正
S3へのアップロードがエラーになった場合、変換完了フラグを立てないように
DBレコードの削除
生成失敗しているのに、DB上で成功になってしまっているデータがあるので、消す
https://image.lgtmoon.dev/128061 までは画像があるっぽい
DBに接続
code:sh
heroku pg:psql
データを見る
code:sql
-- 一応確認したうえで消す
lgtmoon::DATABASE=> select * from image where id > 128061;
id | content_type | created_at | status | bin
--------+--------------+-------------------------+--------+-----
128062 | | 2021-05-26 23:26:20.228 | 1 |
128063 | | 2021-05-26 23:27:38.094 | 1 |
128064 | | 2021-05-26 23:28:10.205 | 1 |
128065 | | 2021-05-27 00:03:23.682 | 1 |
128066 | | 2021-05-27 00:03:40.784 | 1 |
128067 | | 2021-05-27 00:16:39.607 | 1 |
128068 | | 2021-05-27 00:29:33.489 | 1 |
128069 | | 2021-05-27 00:33:16.827 | 1 |
128070 | | 2021-05-27 00:34:03.613 | 1 |
128071 | | 2021-05-27 00:52:48.495 | 1 |
128072 | | 2021-05-27 00:53:43.028 | 1 |
128073 | | 2021-05-27 00:57:20.148 | 1 |
128074 | | 2021-05-27 00:57:58.224 | 0 |
128075 | | 2021-05-27 00:58:35.802 | 1 |
128076 | | 2021-05-27 01:04:58.148 | 1 |
128077 | | 2021-05-27 01:05:36.557 | 1 |
128078 | | 2021-05-27 01:15:14.246 | 1 |
128079 | | 2021-05-27 01:18:32.144 | 1 |
128080 | | 2021-05-27 01:32:21.588 | 1 |
128081 | | 2021-05-27 01:32:29.913 | 1 |
128082 | | 2021-05-27 01:32:56.936 | 1 |
128083 | | 2021-05-27 01:33:06.958 | 1 |
128084 | | 2021-05-27 01:33:11.24 | 1 |
128085 | | 2021-05-27 01:35:17.023 | 1 |
128086 | | 2021-05-27 01:35:25.505 | 1 |
128087 | | 2021-05-27 01:37:11.983 | 1 |
128088 | | 2021-05-27 01:37:18.381 | 1 |
128089 | | 2021-05-27 01:37:27.817 | 1 |
128090 | | 2021-05-27 01:37:30.813 | 1 |
128091 | | 2021-05-27 01:39:33.238 | 1 |
128092 | | 2021-05-27 01:40:22.121 | 1 |
128093 | | 2021-05-27 01:41:02.519 | 1 |
128094 | | 2021-05-27 01:41:09.544 | 1 |
128095 | | 2021-05-27 01:46:37.486 | 1 |
128096 | | 2021-05-27 01:51:06.09 | 1 |
128097 | | 2021-05-27 01:51:32.465 | 1 |
128098 | | 2021-05-27 01:51:50.089 | 1 |
128099 | | 2021-05-27 01:54:23.086 | 1 |
128100 | | 2021-05-27 01:55:58.549 | 1 |
128101 | | 2021-05-27 01:56:44.635 | 1 |
128102 | | 2021-05-27 02:00:56.597 | 1 |
128103 | | 2021-05-27 02:01:37.579 | 1 |
128104 | | 2021-05-27 02:02:20.719 | 1 |
128105 | | 2021-05-27 02:04:47.104 | 1 |
128106 | | 2021-05-27 02:18:55.686 | 1 |
128107 | | 2021-05-27 02:19:23.061 | 1 |
128108 | | 2021-05-27 02:19:33.105 | 1 |
128109 | | 2021-05-27 02:22:28.529 | 1 |
128110 | | 2021-05-27 02:24:25.731 | 1 |
128111 | | 2021-05-27 02:24:41.281 | 1 |
128112 | | 2021-05-27 02:39:07.562 | 0 |
128113 | | 2021-05-27 03:02:37.633 | 1 |
128114 | | 2021-05-27 03:16:16.544 | 0 |
128115 | | 2021-05-27 03:18:52.473 | 1 |
128116 | | 2021-05-27 03:45:54.11 | 1 |
128117 | | 2021-05-27 03:46:27.246 | 1 |
128118 | | 2021-05-27 03:47:32.244 | 1 |
128119 | | 2021-05-27 04:09:40.391 | 0 |
128120 | | 2021-05-27 04:09:48.478 | 0 |
128121 | | 2021-05-27 04:09:54.92 | 0 |
128122 | | 2021-05-27 04:10:01.055 | 0 |
128123 | | 2021-05-27 04:10:25.608 | 0 |
128124 | | 2021-05-27 04:10:40.174 | 0 |
128125 | | 2021-05-27 04:11:02.815 | 1 |
128126 | | 2021-05-27 04:12:28.087 | 1 |
128127 | | 2021-05-27 04:16:02.717 | 1 |
128128 | | 2021-05-27 04:29:51.783 | 1 |
128129 | | 2021-05-27 04:50:34.088 | 1 |
128130 | | 2021-05-27 04:56:48.402 | 1 |
128131 | | 2021-05-27 05:04:52.816 | 1 |
128132 | | 2021-05-27 05:05:45.084 | 1 |
128133 | | 2021-05-27 05:27:41.873 | 1 |
128134 | | 2021-05-27 05:39:31.569 | 1 |
128135 | | 2021-05-27 05:52:13.279 | 1 |
128136 | | 2021-05-27 05:52:41.672 | 1 |
128137 | | 2021-05-27 05:52:48.177 | 1 |
128138 | | 2021-05-27 06:04:33.916 | 1 |
128139 | | 2021-05-27 06:04:41.786 | 1 |
128140 | | 2021-05-27 06:09:22.944 | 1 |
128141 | | 2021-05-27 06:21:38.699 | 1 |
128142 | | 2021-05-27 06:31:07.528 | 1 |
128143 | | 2021-05-27 06:31:13.328 | 1 |
128144 | | 2021-05-27 06:34:32.467 | 0 |
128145 | | 2021-05-27 06:34:38.418 | 0 |
128146 | | 2021-05-27 06:39:37.78 | 1 |
128147 | | 2021-05-27 06:56:07.799 | 1 |
128148 | | 2021-05-27 06:57:37.238 | 1 |
128149 | | 2021-05-27 07:00:47.871 | 1 |
128150 | | 2021-05-27 07:05:47.528 | 1 |
128151 | | 2021-05-27 07:11:45.654 | 1 |
128152 | | 2021-05-27 07:12:16.602 | 1 |
128153 | | 2021-05-27 07:13:07.409 | 1 |
128154 | | 2021-05-27 07:13:41.513 | 1 |
128155 | | 2021-05-27 07:14:18.845 | 1 |
128156 | | 2021-05-27 07:16:43.148 | 0 |
128157 | | 2021-05-27 07:17:27.832 | 0 |
128158 | | 2021-05-27 07:17:44.242 | 1 |
128159 | | 2021-05-27 07:25:58.479 | 1 |
128160 | | 2021-05-27 07:39:34.187 | 1 |
128161 | | 2021-05-27 07:52:25.65 | 0 |
128162 | | 2021-05-27 08:11:07.101 | 1 |
128163 | | 2021-05-27 08:39:11.408 | 0 |
128164 | | 2021-05-27 08:39:55.569 | 1 |
128165 | | 2021-05-27 08:40:27.942 | 1 |
128166 | | 2021-05-27 08:40:35.517 | 1 |
128167 | | 2021-05-27 08:42:30.023 | 1 |
128168 | | 2021-05-27 08:52:21.493 | 1 |
128169 | | 2021-05-27 09:00:54.321 | 1 |
128170 | | 2021-05-27 09:02:47.866 | 0 |
128171 | | 2021-05-27 09:02:54.12 | 0 |
128172 | | 2021-05-27 09:12:08.083 | 1 |
128173 | | 2021-05-27 09:12:15.454 | 1 |
128174 | | 2021-05-27 09:22:17.503 | 1 |
128175 | | 2021-05-27 09:22:29.288 | 1 |
128176 | | 2021-05-27 09:23:18.415 | 1 |
128177 | | 2021-05-27 09:23:46.485 | 1 |
128178 | | 2021-05-27 09:27:36.168 | 1 |
128179 | | 2021-05-27 10:13:15.345 | 1 |
128180 | | 2021-05-27 10:13:24.306 | 1 |
128181 | | 2021-05-27 10:24:53.466 | 1 |
128182 | | 2021-05-27 10:28:15.109 | 1 |
128183 | | 2021-05-27 11:13:48.426 | 1 |
128184 | | 2021-05-27 11:13:55.916 | 1 |
128185 | | 2021-05-27 11:14:15.209 | 1 |
128186 | | 2021-05-27 11:15:58.684 | 1 |
128187 | | 2021-05-27 11:18:28.309 | 1 |
128188 | | 2021-05-27 11:27:59.749 | 1 |
128189 | | 2021-05-27 11:30:59.369 | 1 |
128190 | | 2021-05-27 11:45:31.758 | 1 |
128191 | | 2021-05-27 11:45:37.353 | 1 |
128192 | | 2021-05-27 11:45:41.334 | 1 |
128193 | | 2021-05-27 13:40:56.79 | 1 |
128194 | | 2021-05-27 13:41:03.331 | 1 |
128195 | | 2021-05-27 13:41:14.865 | 1 |
128196 | | 2021-05-27 13:51:28.166 | 1 |
128197 | | 2021-05-27 14:02:02.341 | 1 |
128198 | | 2021-05-27 14:04:59.585 | 0 |
128199 | | 2021-05-27 14:54:18.88 | 1 |
128200 | | 2021-05-27 14:54:32.488 | 1 |
128201 | | 2021-05-27 18:25:08.822 | 1 |
128202 | | 2021-05-28 00:24:23.093 | 1 |
128203 | | 2021-05-28 00:57:17.058 | 1 |
128204 | | 2021-05-28 01:09:29.889 | 1 |
128205 | | 2021-05-28 01:15:34.538 | 1 |
128206 | | 2021-05-28 01:25:18.82 | 1 |
128207 | | 2021-05-28 01:29:20.171 | 1 |
128208 | | 2021-05-28 01:29:29.301 | 1 |
128209 | | 2021-05-28 01:39:54.328 | 1 |
128210 | | 2021-05-28 01:56:05.904 | 1 |
128211 | | 2021-05-28 02:06:39.405 | 1 |
128212 | | 2021-05-28 02:07:04.785 | 1 |
128213 | | 2021-05-28 02:07:44.504 | 1 |
128214 | | 2021-05-28 02:09:52.432 | 1 |
128215 | | 2021-05-28 02:17:41.866 | 1 |
128216 | | 2021-05-28 02:19:37.766 | 1 |
128217 | | 2021-05-28 02:20:28.524 | 1 |
128218 | | 2021-05-28 02:24:06.163 | 1 |
128219 | | 2021-05-28 02:24:46.347 | 1 |
128220 | | 2021-05-28 02:31:32.52 | 1 |
128221 | | 2021-05-28 02:42:05.218 | 1 |
128222 | | 2021-05-28 02:56:39.688 | 1 |
128223 | | 2021-05-28 02:58:42.358 | 1 |
128224 | | 2021-05-28 03:05:35.51 | 0 |
128225 | | 2021-05-28 03:16:16.587 | 1 |
128226 | | 2021-05-28 03:19:55.698 | 1 |
128227 | | 2021-05-28 03:20:19.08 | 1 |
128228 | | 2021-05-28 03:24:05.291 | 1 |
128229 | | 2021-05-28 03:24:22.044 | 1 |
128230 | | 2021-05-28 03:31:02.39 | 1 |
128231 | | 2021-05-28 03:32:40.562 | 1 |
128232 | | 2021-05-28 03:59:56.48 | 1 |
128233 | | 2021-05-28 04:00:03.82 | 1 |
128234 | | 2021-05-28 04:00:22.205 | 1 |
128235 | | 2021-05-28 04:01:29.187 | 1 |
128236 | | 2021-05-28 04:05:17.365 | 1 |
128237 | | 2021-05-28 04:12:41.804 | 1 |
128238 | | 2021-05-28 04:18:27.638 | 1 |
128239 | | 2021-05-28 04:18:35.175 | 1 |
128240 | | 2021-05-28 04:19:22.854 | 1 |
128241 | | 2021-05-28 04:22:12.326 | 1 |
128242 | | 2021-05-28 04:22:24.573 | 1 |
128243 | | 2021-05-28 04:26:10.615 | 1 |
128244 | | 2021-05-28 04:26:17.522 | 1 |
128245 | | 2021-05-28 04:27:31.95 | 1 |
128246 | | 2021-05-28 04:27:38.11 | 1 |
128247 | | 2021-05-28 04:28:19.774 | 1 |
128248 | | 2021-05-28 05:13:34.19 | 1 |
128249 | | 2021-05-28 05:38:51.572 | 1 |
128250 | | 2021-05-28 05:56:04.513 | 0 |
128251 | | 2021-05-28 06:01:37.333 | 1 |
128252 | | 2021-05-28 06:06:00.482 | 1 |
128253 | | 2021-05-28 06:07:42.818 | 0 |
128254 | | 2021-05-28 06:07:51.58 | 0 |
128255 | | 2021-05-28 06:10:25.476 | 0 |
128256 | | 2021-05-28 06:10:25.476 | 0 |
128257 | | 2021-05-28 06:10:39.923 | 0 |
128258 | | 2021-05-28 06:19:20.26 | 1 |
128259 | | 2021-05-28 06:19:38.161 | 1 |
128260 | | 2021-05-28 06:19:58.772 | 1 |
128261 | | 2021-05-28 06:24:35.788 | 1 |
128262 | | 2021-05-28 06:25:37.807 | 1 |
128263 | | 2021-05-28 06:29:46.611 | 1 |
128264 | | 2021-05-28 06:29:56.519 | 1 |
128265 | | 2021-05-28 06:30:01.998 | 1 |
128266 | | 2021-05-28 06:30:40.74 | 1 |
128267 | | 2021-05-28 06:51:33.263 | 0 |
128268 | | 2021-05-28 06:51:41.144 | 1 |
128269 | | 2021-05-28 06:53:32.151 | 1 |
128270 | | 2021-05-28 06:53:40.833 | 1 |
128271 | | 2021-05-28 06:54:48.949 | 1 |
128272 | | 2021-05-28 07:18:07.927 | 1 |
128273 | | 2021-05-28 07:30:24.873 | 1 |
128274 | | 2021-05-28 07:30:32.451 | 1 |
128275 | | 2021-05-28 07:30:39.668 | 1 |
128276 | | 2021-05-28 07:30:54.996 | 1 |
128277 | | 2021-05-28 07:31:32.641 | 1 |
128278 | | 2021-05-28 07:39:31.117 | 1 |
128279 | | 2021-05-28 07:43:47.039 | 0 |
128280 | | 2021-05-28 08:06:09.782 | 1 |
128281 | | 2021-05-28 08:14:22.408 | 1 |
128282 | | 2021-05-28 08:21:09.598 | 1 |
128283 | | 2021-05-28 08:21:16.013 | 1 |
128284 | | 2021-05-28 08:32:39.061 | 0 |
128285 | | 2021-05-28 08:32:57.499 | 0 |
128286 | | 2021-05-28 08:34:06.64 | 1 |
128287 | | 2021-05-28 08:34:23.647 | 1 |
128288 | | 2021-05-28 08:34:36.959 | 1 |
128289 | | 2021-05-28 08:51:27.369 | 1 |
128290 | | 2021-05-28 09:07:50.992 | 1 |
128291 | | 2021-05-28 09:10:19.389 | 1 |
128292 | | 2021-05-28 09:10:24.062 | 1 |
128293 | | 2021-05-28 09:13:36.192 | 1 |
128294 | | 2021-05-28 09:13:42.471 | 1 |
128295 | | 2021-05-28 09:35:50.901 | 1 |
128296 | | 2021-05-28 09:36:25.763 | 1 |
128297 | | 2021-05-28 09:40:14.462 | 1 |
128298 | | 2021-05-28 09:46:28.49 | 1 |
128299 | | 2021-05-28 09:51:33.317 | 1 |
128300 | | 2021-05-28 10:26:53.075 | 1 |
128301 | | 2021-05-28 10:27:00.986 | 1 |
128302 | | 2021-05-28 10:27:16.597 | 1 |
128303 | | 2021-05-28 10:46:27.148 | 1 |
128304 | | 2021-05-28 10:46:46.49 | 1 |
128305 | | 2021-05-28 10:49:00.601 | 1 |
128306 | | 2021-05-28 10:50:39.374 | 1 |
128307 | | 2021-05-28 11:16:27.929 | 1 |
128308 | | 2021-05-28 11:16:34.893 | 1 |
128309 | | 2021-05-28 11:50:05.604 | 1 |
128310 | | 2021-05-28 12:54:46.887 | 1 |
128311 | | 2021-05-28 16:48:54.054 | 1 |
128312 | | 2021-05-28 23:53:21.279 | 1 |
128313 | | 2021-05-29 03:16:15.94 | 1 |
128314 | | 2021-05-29 04:38:02.475 | 1 |
128315 | | 2021-05-29 06:41:36.017 | 1 |
128316 | | 2021-05-29 06:43:17.418 | 1 |
128317 | | 2021-05-29 07:54:52.259 | 1 |
128318 | | 2021-05-29 07:55:00.563 | 1 |
128319 | | 2021-05-29 11:09:03.916 | 1 |
128320 | | 2021-05-29 11:14:19.226 | 1 |
128321 | | 2021-05-29 11:23:18.732 | 1 |
(260 rows)
lgtmoon::DATABASE=> delete from image where id > 128061;
DELETE 260
コードの修正
最初これを参考にしようとしたけど、結局 URL を http にしたら解決
生成された最後の画像が「終わりの始まり」なのも気になるけど...
https://gyazo.com/d95eff788419fb90bdb4f5c4ea1375bf